package com.app.GoCuro.data;

import org.acra.ACRA;
import org.acra.*;
import org.acra.annotation.*;

import android.app.Application;
import com.app.GoCuro.R;

@ReportsCrashes(
	formKey="dE5HNEI2dE5RaWF0VU9fTV90QUZzeVE6MQ",
	mode = ReportingInteractionMode.TOAST,
	forceCloseDialogAfterToast = false, // optional, default false
	resToastText = R.string.crash_toast_text
)

/*
 * Class for containing information needed across activities
 * 
 * This allows persistent access without having to pass repeated information via intent
 */
public class CurrentSession extends Application
{
	LoginResponse currentLogin;
	JobsiteInformation currentJobsite;
	
	/*
	 * Accessors and setters
	 */
	public LoginResponse getLogin()
	{
		return currentLogin;
	}
	
	public void setLogin(LoginResponse login)
	{
		currentLogin = login;
	}

	public JobsiteInformation getJobsite()
	{
		return currentJobsite;
	}
	
	public void SetCurrentJobsite(JobsiteInformation jobsite)
	{
		currentJobsite = jobsite;
	}
	
	@Override
    public void onCreate() {
        // The following line triggers the initialization of ACRA
        ACRA.init(this);
        super.onCreate();
    }

}
